package jianzhiOffer;

public class Num010 {
    public int subarraySum(int[] nums, int k) {
        int count = 0;
        for(int l = 0; l < nums.length; l++) {
            int r = l;
            int num = 0;
            while(r < nums.length) {
                num += nums[r++];
                if(num == k) {
                    count++;
                }else {
                    continue;
                }
            }
        }
        return count;
    }
}
